home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import dbus
- import xml.etree.ElementTree as xml
- from dbus.mainloop.glib import DBusGMainLoop
- DBusGMainLoop(set_as_default = True)
-
- class PackageKit:
-
- def __init__(self):
- bus = dbus.SessionBus()
- obj = bus.get_object('org.freedesktop.PackageKit', '/org/freedesktop/PackageKit')
- num_args = -1
- introsp = dbus.Interface(obj, 'org.freedesktop.DBus.Introspectable')
- api = introsp.Introspect()
- top = xml.etree.ElementTree.XML(api)
- for interface in top.findall('interface'):
- if interface.attrib.get('name') != 'org.freedesktop.PackageKit':
- continue
-
- for method in interface.findall('method'):
- if method.attrib.get('name') != 'InstallPackageName':
- continue
-
- num_args = len(method.findall('arg'))
-
-
- if num_args == -1:
- raise RuntimeError, 'Introspection failed for PackageKit'
- num_args == -1
- self.proxy = dbus.Interface(obj, 'org.freedesktop.PackageKit')
- self.num_args = num_args
-
-
- def InstallPackageName(self, xid, timestamp, name):
- proxy = self.proxy
- if self.num_args == 3:
- return proxy.InstallPackageName(xid, timestamp, name, reply_handler = self.reply_handler, error_handler = self.error_handler)
- return proxy.InstallPackageName(name, reply_handler = self.reply_handler, error_handler = self.error_handler)
-
-
- def reply_handler(self, *args):
- pass
-
-
- def error_handler(self, *args):
- pass
-
-
-